﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace System.Web.Mvc
{
    /// <summary>
    /// Velocity模板Action
    /// </summary>
    public class VelocityResult : System.Web.Mvc.ActionResult
    {
        Org.SpmisFramework.TemplateEngine.VelocityHelper velocity = new Org.SpmisFramework.TemplateEngine.VelocityHelper(@"D:\");
        private string _templateFile = string.Empty;

        public VelocityResult(string templateFile)
        {
            _templateFile = templateFile;
        }

        public override void ExecuteResult(ControllerContext context)
        {
            context.HttpContext.Response.Write(velocity.Render(_templateFile));
        }

        
    }
}
